function* gen() {
    yield 'a'
    yield 'b'
    yield 'c'
    return 'end'
}
let g = gen()

console.log(g.next()) // { value: 'a', done: false }
console.log(g.next()) // { value: 'b', done: false }
console.log(g.next()) // { value: 'c', done: false }
console.log(g.next()) // { value: 'end', done: true }
// console.log(g.next())